package text_2023_09_22;

import java.util.Scanner;

/**
 * @author Vv
 * @version 1.0
 * @project coding_learn
 * @description
 * @date 2023/9/22 09:22:18
 */
public class CountNumAndWord {
    public String str;
    public CountNumAndWord(String s){
        this.str = s;
    }
    public int countNum(){
        int count = 0;
        for(int i = 0;i<str.length();i++){
            count += (str.charAt(i) >= '0' && str.charAt(i) <= '9') ? 1 : 0;
        }
        return count;
    }
    public int countWord(){
        int count = 0;
        for(int i = 0;i<str.length();i++){
            count += ((str.charAt(i) >= 'a' &&str.charAt(i) <= 'z') || (str.charAt(i) >= 'A' && str.charAt(i) <= 'Z')) ? 1 : 0;
        }
        return count;
    }

    public static void main(String[] args) {
        Scanner scanr = new Scanner(System.in);
        String str = scanr.next();
        CountNumAndWord c = new CountNumAndWord(str);
        System.out.println("数字的个数是 ： " + c.countNum());
        System.out.println("字母的个数是 ： " + c.countWord());
    }
}
